package com.sykj.chengqiang.controller;



import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sykj.bean.bis.BisNurseType;
import com.sykj.chengqiang.bean.TypePage;
import com.sykj.chengqiang.service.BisNurseTypeService;
import com.sykj.util.reponse.CommonEnum;
import com.sykj.util.reponse.ResultBody;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/bisNurseTypes")
@CrossOrigin
public class BisNurseTypeController {

    @Autowired
    private BisNurseTypeService bisNurseTypeService;


    @RequestMapping("/aaa")
    public  String aaa(){
        return "ok";
    }

    @RequestMapping("/queyrName")
    public  Object queyrName(BisNurseType bisNurseType){
        return bisNurseTypeService.queyrs(bisNurseType);
    }



    /**
     * 列表查询bisNurseType
     * @return
     */
//    @RequestMapping( value = "queryType")
//    public Object qeuyrBisNurseType(){
//        List<BisNurseType> list = bisNurseTypeService.list();
//        return list;
//    }

    /**
     *
     * 添加savebisNurseType
     * @return
     */
    @RequestMapping("/saveBisNurseType")
    public Object saveBisNurseType(BisNurseType bisNurseType){
        System.out.println(bisNurseType.getCreateTime()+"sssssssssssssssssssssssssssssss");
        System.out.println(bisNurseType.getModifyTime()+"sssssssssssssssssssssssssssssss");
        System.out.println("11111"+ bisNurseType);
        System.out.println("11111"+ bisNurseType.getTypeName());
       return bisNurseTypeService.save(bisNurseType);
//        return new ResultBody(CommonEnum.SUCCESS);
    }


    /**
     *
     * 删除savebisNurseType
     * @return
     */
    @RequestMapping("/deleteType")
    public ResultBody saveBisNurseType(Integer typeId){

            bisNurseTypeService.removeById(typeId);

        return new ResultBody(CommonEnum.SUCCESS);
    }






    @RequestMapping("/queyrById")
    public Object queyrById(Integer typeId){
        BisNurseType bisNurseType=bisNurseTypeService.getById(typeId);

        return bisNurseType;
    }


    /**
     *
     * 根据bisNurseType修改一行数据
     * @return
     */
    @RequestMapping("/updateType")
    public ResultBody updateByIdBisNurseType(BisNurseType bisNurseType){

            bisNurseTypeService.updateById(bisNurseType);

        return new ResultBody(CommonEnum.SUCCESS);
    }





}
